package cn.xiaoniu.day02.util;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Map.Entry;

public class SortUtil {
	/**
	 * 根据count值进行降序排列
	 * @param list
	 */
	public static void sortByCount(ArrayList<Entry<String, Integer>> list) {
		Collections.sort(list, new Comparator<Entry<String, Integer>>() {

			@Override
			public int compare(Entry<String, Integer> o1, Entry<String, Integer> o2) {
				return o2.getValue()-o1.getValue();
			}
		});
		
	}

}
